package com.winit.schedule.core.localstore.leveldb;

import com.winit.schedule.core.localstore.LocalStore;
import com.winit.schedule.core.localstore.LocalStoreConfig;
import com.winit.schedule.core.localstore.LocalStoreFactory;
import com.winit.schedule.core.utils.StringUtils;

public class LeveldbLocalStoreFactory implements LocalStoreFactory {

    @Override
    public LocalStore getLocalStore(LocalStoreConfig config, String storePath) {
        if (StringUtils.isEmpty(storePath)) {
            storePath = config.getLocalStorePath();
        }
        return new LeveldbLocalStore(storePath, config.getIdentity());
    }

}
